package response

type Response struct {
	Success bool   `json:"success"`
	Error   string `json:"error,omitempty"`

	Answer string `json:"result,omitempty"`
}

const (
	StatusOk    = true
	StatusError = false
)

func Ok() *Response {
	return &Response{
		Success: StatusOk,
	}

}

func Error(error string) *Response {
	return &Response{
		Success: StatusError,
		Error:   error,
		Answer:  "",
	}
}

func Success(answer string) *Response {
	return &Response{
		Success: StatusOk,
		Answer:  answer,
	}

}
